package offer.algorithm;

/**
 * Description：
 * Author: zhangc
 * Date：2017/7/27 13:56
 */
public class FirstNotrepeatChar35 {

    public static char getFirstNotRepeatChar(String string) {
        if (string != null && string.length() > 0) {
            char[] chars = string.toCharArray();
            char temp;
            for (int i = 0; i < chars.length; i++) {
                temp = chars[ i ];
                int j = chars.length - 1;
                for (; j > i; --j) {
                    if (chars[ j ] == temp)
                        break;
                }
                if (j == i)
                    return temp;
            }
        }
        return ' ';
    }

}
